/**
 * 
 */
package javapop.framework.parser.expr.generic;

import javapop.framework.generic.GExprOperator;
import javapop.framework.generic.GExprOperator.Type;
import javapop.framework.parser.expr.ExprNode;
import javapop.framework.parser.expr.PrefixNode;

/**
 * @author Hakim
 *
 */
public class CPrefixNode<T> extends CExprNode<T> implements PrefixNode {

	private GExprOperator op;
	private ExprNode operand;
	private int prio;
	/**
	 * 
	 */
	public CPrefixNode(GExprOperator op,T data) {
		super(data);
		this.op = op;
		this.prio = op.getPrio();
		assert(op.getType() == Type.PREFIX);
	}

	@Override
	public ExprNode getOperand() {
		return operand;
	}

	@Override
	public void setOperand(ExprNode operand) {
		this.operand =operand ;
	}

	@Override
	public int getPrio() {
		return prio;
	}

	@Override
	public void setPrio(int prio) {
		this.prio = prio;
	}
	
	@Override
	public boolean isPrefix() {
		return true;
	}
	
	
}
